package br.com.knowledge.persistence.hibernate.entities;

import java.util.ArrayList;
import java.util.HashSet;
import java.util.List;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToMany;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;

/**
 * BcdTabelas entity. @author MyEclipse Persistence Tools
 */
@Entity
@Table(name = "bcd_tabelas", schema = "public")
public class BcdTabelas implements java.io.Serializable {

	// Fields

	private Integer id;
	private CadProjeto cadProjeto;
	private String nometabela;
	private String descricao;	
	private Set<BcdTrigger> bcdTriggers = new HashSet<BcdTrigger>(0);
	private Set<FntFonte> fntFontes = new HashSet<FntFonte>(0);
	private Set<BcdColunas> bcdColunases = new HashSet<BcdColunas>(0);
	private Set<BcdColunas> bcdColunases_1 = new HashSet<BcdColunas>(0);
	private Set<BcdTrigger> bcdTriggers_1 = new HashSet<BcdTrigger>(0);

	// Constructors

	/** default constructor */
	public BcdTabelas() {
	
	
	}

	/** minimal constructor */
	public BcdTabelas(CadProjeto cadProjeto) {
		this.cadProjeto = cadProjeto;
	}

	/** full constructor */
	public BcdTabelas(CadProjeto cadProjeto, String nometabela,
			String descricao, Set<BcdTrigger> bcdTriggers,
			Set<FntFonte> fntFontes, Set<BcdColunas> bcdColunases,
			Set<BcdColunas> bcdColunases_1, Set<BcdTrigger> bcdTriggers_1) {
		this.cadProjeto = cadProjeto;
		this.nometabela = nometabela;
		this.descricao = descricao;
		this.bcdTriggers = bcdTriggers;
		this.fntFontes = fntFontes;
		this.bcdColunases = bcdColunases;
		this.bcdColunases_1 = bcdColunases_1;
		this.bcdTriggers_1 = bcdTriggers_1;
	}

	// Property accessors
	@GenericGenerator(name = "generator", strategy = "increment")
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "id", unique = true, nullable = false)
	public Integer getId() {
		return this.id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "cad_projeto_id", nullable = false)
	public CadProjeto getCadProjeto() {
		return this.cadProjeto;
	}

	public void setCadProjeto(CadProjeto cadProjeto) {
		this.cadProjeto = cadProjeto;
	}

	@Column(name = "nometabela", length = 50)
	public String getNometabela() {
		return this.nometabela;
	}

	public void setNometabela(String nometabela) {
		this.nometabela = nometabela;
	}

	@Column(name = "descricao")
	public String getDescricao() {
		return this.descricao;
	}

	public void setDescricao(String descricao) {
		this.descricao = descricao;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bcdTabelas")
	public Set<BcdTrigger> getBcdTriggers() {
		return this.bcdTriggers;
	}

	public void setBcdTriggers(Set<BcdTrigger> bcdTriggers) {
		this.bcdTriggers = bcdTriggers;
	}

	@ManyToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bcdTabelases")
	public Set<FntFonte> getFntFontes() {
		return this.fntFontes;
	}

	public void setFntFontes(Set<FntFonte> fntFontes) {
		this.fntFontes = fntFontes;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bcdTabelas")
	public Set<BcdColunas> getBcdColunases() {
		return this.bcdColunases;
	}

	public void setBcdColunases(Set<BcdColunas> bcdColunases) {
		this.bcdColunases = bcdColunases;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bcdTabelas")
	public Set<BcdColunas> getBcdColunases_1() {
		return this.bcdColunases_1;
	}

	public void setBcdColunases_1(Set<BcdColunas> bcdColunases_1) {
		this.bcdColunases_1 = bcdColunases_1;
	}

	@OneToMany(cascade = CascadeType.ALL, fetch = FetchType.LAZY, mappedBy = "bcdTabelas")
	public Set<BcdTrigger> getBcdTriggers_1() {
		return this.bcdTriggers_1;
	}

	public void setBcdTriggers_1(Set<BcdTrigger> bcdTriggers_1) {
		this.bcdTriggers_1 = bcdTriggers_1;
	}
}